home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / AIncludes / FileTransfers.a < prev    next >
Encoding:
Text File  |  1995-04-18  |  9.2 KB  |  391 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        FileTransfers.a
  3. ;
  4. ;    Contains:    CommToolbox File Transfer Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__FILETRANSFERS__') = 'UNDEFINED' THEN
  21. __FILETRANSFERS__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__WINDOWS__') = 'UNDEFINED' THEN
  25.     include 'Windows.a'
  26.     ENDIF
  27. ;        include 'Types.a'                                            ;
  28. ;            include 'ConditionalMacros.a'                            ;
  29. ;        include 'Memory.a'                                            ;
  30. ;            include 'MixedMode.a'                                    ;
  31. ;        include 'Quickdraw.a'                                        ;
  32. ;            include 'QuickdrawText.a'                                ;
  33. ;        include 'Events.a'                                            ;
  34. ;            include 'OSUtils.a'                                    ;
  35. ;        include 'Controls.a'                                        ;
  36. ;            include 'Menus.a'                                        ;
  37.  
  38.     IF &TYPE('__CTBUTILITIES__') = 'UNDEFINED' THEN
  39.     include 'CTBUtilities.a'
  40.     ENDIF
  41. ;        include 'Dialogs.a'                                        ;
  42. ;            include 'Errors.a'                                        ;
  43. ;            include 'TextEdit.a'                                    ;
  44. ;        include 'StandardFile.a'                                    ;
  45. ;            include 'Files.a'                                        ;
  46. ;        include 'AppleTalk.a'                                        ;
  47.  
  48.     IF &TYPE('__CONNECTIONS__') = 'UNDEFINED' THEN
  49.     include 'Connections.a'
  50.     ENDIF
  51.  
  52.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  53.     include 'Files.a'
  54.     ENDIF
  55.  
  56.     IF &TYPE('__TERMINALS__') = 'UNDEFINED' THEN
  57.     include 'Terminals.a'
  58.     ENDIF
  59.  
  60. ; current file transfer manager version    
  61. curFTVersion                    EQU        2
  62. ; FTErr    
  63. ftGenericError                    EQU        -1
  64. ftNoErr                            EQU        0
  65. ftRejected                        EQU        1
  66. ftFailed                        EQU        2
  67. ftTimeOut                        EQU        3
  68. ftTooManyRetry                    EQU        4
  69. ftNotEnoughDSpace                EQU        5
  70. ftRemoteCancel                    EQU        6
  71. ftWrongFormat                    EQU        7
  72. ftNoTools                        EQU        8
  73. ftUserCancel                    EQU        9
  74. ftNotSupported                    EQU        10
  75.  
  76. ; typedef OSErr             FTErr
  77.  
  78. ftIsFTMode                        EQU        1 << 0
  79. ftNoMenus                        EQU        1 << 1
  80. ftQuiet                            EQU        1 << 2
  81. ftConfigChanged                    EQU        1 << 4
  82. ftSucc                            EQU        1 << 7
  83.  
  84. ; typedef unsigned long     FTFlags
  85.  
  86. ftSameCircuit                    EQU        1 << 0
  87. ftSendDisable                    EQU        1 << 1
  88. ftReceiveDisable                EQU        1 << 2
  89. ftTextOnly                        EQU        1 << 3
  90. ftNoStdFile                        EQU        1 << 4
  91. ftMultipleFileSend                EQU        1 << 5
  92.  
  93. ; typedef unsigned short     FTAttributes
  94.  
  95. ftReceiving                        EQU        0
  96. ftTransmitting                    EQU        1
  97.  
  98. ; typedef unsigned short     FTDirection
  99. ;    application routines type definitions 
  100. ; typedef struct FTRecord     FTRecord, *FTPtr, **FTHandle
  101. FTRecord                 RECORD    0
  102. procID                     ds.w   1        ; offset: $0 (0)
  103. flags                     ds.l   1        ; offset: $2 (2)
  104. errCode                     ds.w   1        ; offset: $6 (6)
  105. refCon                     ds.l   1        ; offset: $8 (8)
  106. userData                 ds.l   1        ; offset: $C (12)
  107. defProc                     ds.l   1        ; offset: $10 (16)
  108. config                     ds.l   1        ; offset: $14 (20)
  109. oldConfig                 ds.l   1        ; offset: $18 (24)
  110. environsProc             ds.l   1        ; offset: $1C (28)
  111. reserved1                 ds.l   1        ; offset: $20 (32)
  112. reserved2                 ds.l   1        ; offset: $24 (36)
  113. ftPrivate                 ds.l   1        ; offset: $28 (40)
  114. sendProc                 ds.l   1        ; offset: $2C (44)
  115. recvProc                 ds.l   1        ; offset: $30 (48)
  116. writeProc                 ds.l   1        ; offset: $34 (52)
  117. readProc                 ds.l   1        ; offset: $38 (56)
  118. owner                     ds.l   1        ; offset: $3C (60)
  119. direction                 ds.w   1        ; offset: $40 (64)
  120. theReply                 ds     SFReply    ; offset: $42 (66)
  121. writePtr                 ds.l   1        ; offset: $8C (140)
  122. readPtr                     ds.l   1        ; offset: $90 (144)
  123. theBuf                     ds.l   1        ; offset: $94 (148)
  124. bufSize                     ds.l   1        ; offset: $98 (152)
  125. autoRec                     ds.l   64        ; offset: $9C (156)
  126. attributes                 ds.w   1        ; offset: $19C (412)
  127. sizeof                     EQU *            ; size:   $19E (414)
  128.                         ENDR
  129.  
  130.  
  131. ; FTReadProc messages 
  132. ftReadOpenFile                    EQU        0                    ; count = forkFlags, buffer = pblock from PBGetFInfo 
  133. ftReadDataFork                    EQU        1
  134. ftReadRsrcFork                    EQU        2
  135. ftReadAbort                        EQU        3
  136. ftReadComplete                    EQU        4
  137. ftReadSetFPos                    EQU        6                    ; count = forkFlags, buffer = pBlock same as PBSetFPos 
  138. ftReadGetFPos                    EQU        7                    ; count = forkFlags, buffer = pBlock same as PBGetFPos 
  139. ; FTWriteProc messages 
  140. ftWriteOpenFile                    EQU        0                    ; count = forkFlags, buffer = pblock from PBGetFInfo 
  141. ftWriteDataFork                    EQU        1
  142. ftWriteRsrcFork                    EQU        2
  143. ftWriteAbort                    EQU        3
  144. ftWriteComplete                    EQU        4
  145. ftWriteFileInfo                    EQU        5
  146. ftWriteSetFPos                    EQU        6                    ; count = forkFlags, buffer = pBlock same as PBSetFPos 
  147. ftWriteGetFPos                    EQU        7                    ; count = forkFlags, buffer = pBlock same as PBGetFPos 
  148. ;    fork flags 
  149. ftOpenDataFork                    EQU        1
  150. ftOpenRsrcFork                    EQU        2
  151.  
  152. ;
  153. ; pascal FTErr InitFT(void)
  154. ;
  155.     IF GENERATINGCFM THEN
  156.         IMPORT_CFM_FUNCTION    InitFT
  157.     ENDIF
  158.  
  159. ;
  160. ; pascal Handle FTGetVersion(FTHandle hFT)
  161. ;
  162.     IF GENERATINGCFM THEN
  163.         IMPORT_CFM_FUNCTION    FTGetVersion
  164.     ENDIF
  165.  
  166. ;
  167. ; pascal short FTGetFTVersion(void)
  168. ;
  169.     IF GENERATINGCFM THEN
  170.         IMPORT_CFM_FUNCTION    FTGetFTVersion
  171.     ENDIF
  172.  
  173. ;
  174. ; pascal FTHandle FTNew(short procID, FTFlags flags, FileTransferSendUPP sendProc, FileTransferReceiveUPP recvProc, FileTransferReadUPP readProc, FileTransferWriteUPP writeProc, FileTransferEnvironsUPP environsProc, WindowPtr owner, long refCon, long userData)
  175. ;
  176.     IF GENERATINGCFM THEN
  177.         IMPORT_CFM_FUNCTION    FTNew
  178.     ENDIF
  179.  
  180. ;
  181. ; pascal void FTDispose(FTHandle hFT)
  182. ;
  183.     IF GENERATINGCFM THEN
  184.         IMPORT_CFM_FUNCTION    FTDispose
  185.     ENDIF
  186.  
  187. ;
  188. ; pascal FTErr FTStart(FTHandle hFT, FTDirection direction, const SFReply *fileInfo)
  189. ;
  190.     IF GENERATINGCFM THEN
  191.         IMPORT_CFM_FUNCTION    FTStart
  192.     ENDIF
  193.  
  194. ;
  195. ; pascal FTErr FTAbort(FTHandle hFT)
  196. ;
  197.     IF GENERATINGCFM THEN
  198.         IMPORT_CFM_FUNCTION    FTAbort
  199.     ENDIF
  200.  
  201. ;
  202. ; pascal FTErr FTSend(FTHandle hFT, short numFiles, FSSpecArrayPtr pFSSpec, FileTransferNotificationUPP notifyProc)
  203. ;
  204.     IF GENERATINGCFM THEN
  205.         IMPORT_CFM_FUNCTION    FTSend
  206.     ENDIF
  207.  
  208. ;
  209. ; pascal FTErr FTReceive(FTHandle hFT, FSSpecPtr pFSSpec, FileTransferNotificationUPP notifyProc)
  210. ;
  211.     IF GENERATINGCFM THEN
  212.         IMPORT_CFM_FUNCTION    FTReceive
  213.     ENDIF
  214.  
  215. ;
  216. ; pascal void FTExec(FTHandle hFT)
  217. ;
  218.     IF GENERATINGCFM THEN
  219.         IMPORT_CFM_FUNCTION    FTExec
  220.     ENDIF
  221.  
  222. ;
  223. ; pascal void FTActivate(FTHandle hFT, Boolean activate)
  224. ;
  225.     IF GENERATINGCFM THEN
  226.         IMPORT_CFM_FUNCTION    FTActivate
  227.     ENDIF
  228.  
  229. ;
  230. ; pascal void FTResume(FTHandle hFT, Boolean resume)
  231. ;
  232.     IF GENERATINGCFM THEN
  233.         IMPORT_CFM_FUNCTION    FTResume
  234.     ENDIF
  235.  
  236. ;
  237. ; pascal Boolean FTMenu(FTHandle hFT, short menuID, short item)
  238. ;
  239.     IF GENERATINGCFM THEN
  240.         IMPORT_CFM_FUNCTION    FTMenu
  241.     ENDIF
  242.  
  243. ;
  244. ; pascal short FTChoose(FTHandle *hFT, Point where, FileTransferChooseIdleUPP idleProc)
  245. ;
  246.     IF GENERATINGCFM THEN
  247.         IMPORT_CFM_FUNCTION    FTChoose
  248.     ENDIF
  249.  
  250. ;
  251. ; pascal void FTEvent(FTHandle hFT, const EventRecord *theEvent)
  252. ;
  253.     IF GENERATINGCFM THEN
  254.         IMPORT_CFM_FUNCTION    FTEvent
  255.     ENDIF
  256.  
  257. ;
  258. ; pascal Boolean FTValidate(FTHandle hFT)
  259. ;
  260.     IF GENERATINGCFM THEN
  261.         IMPORT_CFM_FUNCTION    FTValidate
  262.     ENDIF
  263.  
  264. ;
  265. ; pascal void FTDefault(Ptr *theConfig, short procID, Boolean allocate)
  266. ;
  267.     IF GENERATINGCFM THEN
  268.         IMPORT_CFM_FUNCTION    FTDefault
  269.     ENDIF
  270.  
  271. ;
  272. ; pascal Handle FTSetupPreflight(short procID, long *magicCookie)
  273. ;
  274.     IF GENERATINGCFM THEN
  275.         IMPORT_CFM_FUNCTION    FTSetupPreflight
  276.     ENDIF
  277.  
  278. ;
  279. ; pascal void FTSetupSetup(short procID, const void *theConfig, short count, DialogPtr theDialog, long *magicCookie)
  280. ;
  281.     IF GENERATINGCFM THEN
  282.         IMPORT_CFM_FUNCTION    FTSetupSetup
  283.     ENDIF
  284.  
  285. ;
  286. ; pascal Boolean FTSetupFilter(short procID, const void *theConfig, short count, DialogPtr theDialog, EventRecord *theEvent, short *theItem, long *magicCookie)
  287. ;
  288.     IF GENERATINGCFM THEN
  289.         IMPORT_CFM_FUNCTION    FTSetupFilter
  290.     ENDIF
  291.  
  292. ;
  293. ; pascal void FTSetupItem(short procID, const void *theConfig, short count, DialogPtr theDialog, short *theItem, long *magicCookie)
  294. ;
  295.     IF GENERATINGCFM THEN
  296.         IMPORT_CFM_FUNCTION    FTSetupItem
  297.     ENDIF
  298.  
  299. ;
  300. ; pascal void FTSetupXCleanup(short procID, const void *theConfig, short count, DialogPtr theDialog, Boolean OKed, long *magicCookie)
  301. ;
  302.     IF GENERATINGCFM THEN
  303.         IMPORT_CFM_FUNCTION    FTSetupXCleanup
  304.     ENDIF
  305.  
  306. ;
  307. ; pascal void FTSetupPostflight(short procID)
  308. ;
  309.     IF GENERATINGCFM THEN
  310.         IMPORT_CFM_FUNCTION    FTSetupPostflight
  311.     ENDIF
  312.  
  313. ;
  314. ; pascal Ptr FTGetConfig(FTHandle hFT)
  315. ;
  316.     IF GENERATINGCFM THEN
  317.         IMPORT_CFM_FUNCTION    FTGetConfig
  318.     ENDIF
  319.  
  320. ;
  321. ; pascal short FTSetConfig(FTHandle hFT, const void *thePtr)
  322. ;
  323.     IF GENERATINGCFM THEN
  324.         IMPORT_CFM_FUNCTION    FTSetConfig
  325.     ENDIF
  326.  
  327. ;
  328. ; pascal OSErr FTIntlToEnglish(FTHandle hFT, const void *inputPtr, Ptr *outputPtr, short language)
  329. ;
  330.     IF GENERATINGCFM THEN
  331.         IMPORT_CFM_FUNCTION    FTIntlToEnglish
  332.     ENDIF
  333.  
  334. ;
  335. ; pascal OSErr FTEnglishToIntl(FTHandle hFT, const void *inputPtr, Ptr *outputPtr, short language)
  336. ;
  337.     IF GENERATINGCFM THEN
  338.         IMPORT_CFM_FUNCTION    FTEnglishToIntl
  339.     ENDIF
  340.  
  341. ;
  342. ; pascal void FTGetToolName(short procID, Str255 name)
  343. ;
  344.     IF GENERATINGCFM THEN
  345.         IMPORT_CFM_FUNCTION    FTGetToolName
  346.     ENDIF
  347.  
  348. ;
  349. ; pascal short FTGetProcID(ConstStr255Param name)
  350. ;
  351.     IF GENERATINGCFM THEN
  352.         IMPORT_CFM_FUNCTION    FTGetProcID
  353.     ENDIF
  354.  
  355. ;
  356. ; pascal void FTSetRefCon(FTHandle hFT, long refCon)
  357. ;
  358.     IF GENERATINGCFM THEN
  359.         IMPORT_CFM_FUNCTION    FTSetRefCon
  360.     ENDIF
  361.  
  362. ;
  363. ; pascal long FTGetRefCon(FTHandle hFT)
  364. ;
  365.     IF GENERATINGCFM THEN
  366.         IMPORT_CFM_FUNCTION    FTGetRefCon
  367.     ENDIF
  368.  
  369. ;
  370. ; pascal void FTSetUserData(FTHandle hFT, long userData)
  371. ;
  372.     IF GENERATINGCFM THEN
  373.         IMPORT_CFM_FUNCTION    FTSetUserData
  374.     ENDIF
  375.  
  376. ;
  377. ; pascal long FTGetUserData(FTHandle hFT)
  378. ;
  379.     IF GENERATINGCFM THEN
  380.         IMPORT_CFM_FUNCTION    FTGetUserData
  381.     ENDIF
  382.  
  383. ;
  384. ; pascal void FTGetErrorString(FTHandle hFT, short id, Str255 errMsg)
  385. ;
  386.     IF GENERATINGCFM THEN
  387.         IMPORT_CFM_FUNCTION    FTGetErrorString
  388.     ENDIF
  389.  
  390.     ENDIF ; __FILETRANSFERS__
  391.